home *** CD-ROM | disk | FTP | other *** search
- /* LISTING 8 - OBJ.C */
- /* implement a 'constructor' to do the
- circle object startup */
-
- #include <stdio.h>
- #include "obj.h"
-
- #define SETCOLOR 0
- #define GETCOLOR 1
-
- main()
- {
- int col;
-
- /* create a new circle c1 to work with */
- CIRCLE c1;
-
-
- /* call the constructor function for c1 */
- constructor(&c1, 14);
-
- /* use GETCOLOR message to get color */
- col = (*(c1.pcact->pcact[GETCOLOR]))(&c1);
- printf("c1 is color %d\n", col);
- }
-
-
-
-